package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DbDetailMapper;
import com.ruoyi.system.domain.DbDetail;
import com.ruoyi.system.service.IDbDetailService;

/**
 * 订单绑定商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-08
 */
@Service
public class DbDetailServiceImpl implements IDbDetailService 
{
    @Autowired
    private DbDetailMapper dbDetailMapper;

    /**
     * 查询订单绑定商品
     * 
     * @param id 订单绑定商品主键
     * @return 订单绑定商品
     */
    @Override
    public DbDetail selectDbDetailById(Long id)
    {
        return dbDetailMapper.selectDbDetailById(id);
    }

    /**
     * 查询订单绑定商品列表
     * 
     * @param dbDetail 订单绑定商品
     * @return 订单绑定商品
     */
    @Override
    public List<DbDetail> selectDbDetailList(DbDetail dbDetail)
    {
        return dbDetailMapper.selectDbDetailList(dbDetail);
    }

    /**
     * 新增订单绑定商品
     * 
     * @param dbDetail 订单绑定商品
     * @return 结果
     */
    @Override
    public int insertDbDetail(DbDetail dbDetail)
    {
        dbDetail.setCreateTime(DateUtils.getNowDate());
        return dbDetailMapper.insertDbDetail(dbDetail);
    }

    /**
     * 修改订单绑定商品
     * 
     * @param dbDetail 订单绑定商品
     * @return 结果
     */
    @Override
    public int updateDbDetail(DbDetail dbDetail)
    {
        dbDetail.setUpdateTime(DateUtils.getNowDate());
        return dbDetailMapper.updateDbDetail(dbDetail);
    }

    /**
     * 批量删除订单绑定商品
     * 
     * @param ids 需要删除的订单绑定商品主键
     * @return 结果
     */
    @Override
    public int deleteDbDetailByIds(Long[] ids)
    {
        return dbDetailMapper.deleteDbDetailByIds(ids);
    }

    /**
     * 删除订单绑定商品信息
     * 
     * @param id 订单绑定商品主键
     * @return 结果
     */
    @Override
    public int deleteDbDetailById(Long id)
    {
        return dbDetailMapper.deleteDbDetailById(id);
    }
}
